<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        table {
            border-collapse: collapse;
        }
        td {
            width: 100px;
            border: 1px solid #000;
        }
        .active{
            background-color: red;
        }
    </style>
</head>
<body>
    <div>
        <h1>请你选择你登录的方式</h1>
    </div>
    <div id="app">
        <router-link to="/name">账号名密码</router-link>
        <router-link to="/png">二维码</router-link>
        <router-view></router-view>
    </div>
    <template id="ta1">
        <div>
            <h2>注册信息</h2>
            <table>
                <tr>
                    <td>用户名</td>
                    <td></td>
                </tr>
                <tr>
                    <td>密码</td>
                    <td></td>
                </tr>
                <tr>
                    <td>重复密码</td>
                    <td></td>
                </tr>
                <tr>
                    <td>验证码</td>
                    <td></td>
                </tr>
                <tr>
                    <td colspan="2" style="text-align: center;"><button>注册新用户</button></td>
                </tr>
            </table>
        </div>
    </template>
    <template id="ta2">
          <div>
              <h2>扫我二维码</h2>
              <img src="./char.jpg" alt="">
          </div>
    </template>
</body>
<script src="./vue.js"></script>
<script src="./vue-router.js"></script>

<script>
    let biaodan= {
        template:"#ta1"
    }
    let png= {
        template:"#ta2"
    }
    const routerObj = new VueRouter({
        routes:[
            {path: "/name", name:"name", component: biaodan},
            {path: "/png", name:"png", component: png},
        ],
        linkActiveClass:"active"
    })
    let vm = new Vue({
         el: "#app",
         router: routerObj
    })
</script>
</html>